
             
/**
 * 
 *
 * @File name:  QueryTFixedAssetsDetailByPagerAction.java 
 * @Create on:  2011-10-31 09:21:937
 * @Author   :  许福辉
 *
 * @ChangeList
 * ---------------------------------------------------
 * Date         Editor              ChangeReasons
 *
 */
           
        
package com.boho.estates.usual.action;

            
import java.sql.Connection;

import cn.boho.framework.actions.ActionImp;
import cn.boho.framework.context.ActionContext;
import cn.boho.framework.po.ComboPager;
import cn.boho.framework.po.Pager;
import cn.boho.framework.service.MessageService;

import com.boho.base.dao.DaoHelper;
import com.boho.estates.usual.service.UsualService;

public class QueryTFixedChangeFlowByTypePagerAction extends ActionImp {
	private Connection con=null;
	private Pager pager=null;
	private int pageSize = 10;
	private int currentPage = 1;
	private String barcode = "";
	private String changeType = "";
	@Override
	protected void doException(ActionContext atx, Exception ex) {
		atx.setErrorContext("BOHO_COMMON_1004", MessageService.getMessage("BOHO_COMMON_1004"),"【资产详细信息】" ,ex);
	}
	@Override
	protected int performExecute(ActionContext atx) throws Exception {
		pager = new Pager(pageSize, currentPage);
		ComboPager cp=UsualService.queryTFixedChangeFlowByIdPager(con,pager,barcode,changeType);
		DaoHelper.setTsuppliersField(con, cp, "_NAME", "SUPPLIERS_NO");//替换供应商
		atx.setValue("T_FA_CHANGE_FLOW", cp);
		return 1;
	}
	@Override
	protected int verifyParameters(ActionContext atx) throws Exception {
		con = atx.getConection();
		if(atx.getStringValue("PAGE_SIZE")!=null&&!atx.getStringValue("PAGE_SIZE").equals("")){
			pageSize = new Integer(atx.getStringValue("PAGE_SIZE"));
		}
		if(atx.getStringValue("CURRENT_PAGE")!=null&&!atx.getStringValue("CURRENT_PAGE").equals("")){
			currentPage = new Integer(atx.getStringValue("CURRENT_PAGE"));
		}
		barcode = atx.getStringValue("BARCODE","");
		changeType = atx.getStringValue("CHANGE_TYPE","");
		return 1;
	}
}
